//
//  HttpRequest.m
//  RuiBenO2O
//
//  Created by LiYinDi on 14-10-14.
//  Copyright (c) 2014年 RuiBen. All rights reserved.
//

#import "HttpRequest.h"
#import "HttpBaseModel.h"

@implementation HttpRequest
+(void)requestData:(NSString *)dataPath params:(NSMutableDictionary *)params success:(void(^)(BOOL isSuccess,SeverData *severDataDict))success
{
    [HttpBaseModel severRequest:dataPath params:params onCompletion:^(NSDictionary *responseData)
     {
         SeverData *dataContent=[[SeverData alloc] init];
         dataContent.dataDict=responseData;
         success(YES,dataContent);
     }
      onError:^(NSString *error)
     {
         SeverData *dataContent=[[SeverData alloc] init];
         dataContent.resultStr=error;
         if ([dataContent.resultStr isEqualToString:@"不支持的 URL"]) {
             dataContent.resultStr=@"您还没通过身份认证，暂无权访问，请先认证";
         }
         success(NO,dataContent);
     }];
}


+(void)requestData1:(NSString *)dataPath params:(NSMutableDictionary *)params success:(void(^)(BOOL isSuccess,SeverData *severDataDict))success
{
    [HttpBaseModel severRequest1:dataPath params:params onCompletion:^(NSDictionary *responseData)
     {
         SeverData *dataContent=[[SeverData alloc] init];
         dataContent.dataDict=responseData;
         success(YES,dataContent);
     }
                        onError:^(NSString *error)
     {
         SeverData *dataContent=[[SeverData alloc] init];
         dataContent.resultStr=error;
         success(NO,dataContent);
     }];
}


@end
